@extends('layout.app') @section('content')

    <div class="box-body">

        <table id="rowed3"></table>
        <div id="prowed3"></div>

    </div>

    <script>
        $(document).ready(function() {

            var data = {
                url: "/lottery/touzhu",
                postData: postData(),
                colNames: ["类型" , "0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" , ""],
                colModel: [{
                    name: 'name',
                    width: 80,
                }, {
                    name: '0',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        if (object.type == 0) {
                            return '<a href="/order/order?ids=' + object.ids0 + '">' + cellvalue + '</a>';
                        } else {
                            return '<a href="/order/order?ids=' + object.ids + '">' + cellvalue + '</a>';
                        }
                    }
                }, {
                    name: '1',
                    width: 80,
                    cellattr: function(rowId, val, rawObject, cm, rdata) {
                        if (rowId > 3) {
                            return "colspan='9'";
                        }
                    },
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids1+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '2',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids2+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '3',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids3+'">'+cellvalue+'</a>';
                    }
                },  {
                    name: '4',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids4+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '5',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids5+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '6',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids6+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '7',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids7+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '8',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids8+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: '9',
                    width: 80,
                    formatter: function(cellvalue, options, object) {
                        if (cellvalue === "0" || cellvalue === 0) {
                            return '0';
                        }
                        if (!cellvalue) {
                            return '';
                        }
                        return '<a href="/order/order?ids='+object.ids9+'">'+cellvalue+'</a>';
                    }
                }, {
                    name: 'cond',
                    hidden: true
                }],
                caption: '-',
                sortname: 'number',
                sortorder: "desc",
                autowidth: false,
                footerrow: false,
                gridComplete: function() {
                    var cond = $(this).getCol("cond")[0];
                    $(".ui-jqgrid-title").html(cond);
                }
            };

            jqGrid(data, false, false, false);
        });

        function postData() {
            return {
                @if($request->get("number"))
                	number: '{{$request->get("number")}}',
                @endif
                @if($request->get("date"))
                	date: '{{$request->get("date")}}',
                @endif
                @if($request->get("chao_zongdai"))
                	chao_zongdai: '{{$request->get("chao_zongdai")}}',
                @endif
                @if($request->get("zongdai"))
                	zongdai: '{{$request->get("zongdai")}}',
                @endif
            }
        }

    </script>

@endsection